#include "YGInputWM6.h"
#include "YGDevice.h"

namespace YoghurtGum
{

	// ================================
	// Keyboard
	// ================================

	KeyboardWM6::KeyboardWM6() : Keyboard()
	{
		int i = 0;
	}
	
	KeyboardWM6::~KeyboardWM6()
	{
		
	}

	void KeyboardWM6::Init()
	{
		for (int i = 0; i < 512; ++i)
		{
			m_KeysPressed[i] = false;
			m_KeysReleased[i] = false;
		}
	}

	void KeyboardWM6::Clear()
	{
		for (int i = 0; i < 512; ++i)
		{
			m_KeysReleased[i] = false;
		}
	}

	void KeyboardWM6::Update()
	{

	}

	void KeyboardWM6::InjectPress(Key a_Key)
	{
		m_KeysPressed[a_Key] = true;
	}

	void KeyboardWM6::InjectRelease(Key a_Key)
	{
		m_KeysReleased[a_Key] = true;
		m_KeysPressed[a_Key] = false;
	}

	bool KeyboardWM6::Pressed(Key a_Key)
	{
		return (m_KeysPressed[a_Key]);
	}

	bool KeyboardWM6::Released(Key a_Key)
	{
		return (false);
	}

	// ==========================================
	// TouchScreen
	// ==========================================

	TouchScreenWM6::TouchScreenWM6()
	{

	}

	TouchScreenWM6::~TouchScreenWM6()
	{

	}

	void TouchScreenWM6::Init()
	{
		m_DeviceX = 1.f / (float)Device::Get().GetWidth();
		m_DeviceY = 1.f / (float)Device::Get().GetHeight();
	}

	void TouchScreenWM6::InjectPress(float a_X, float a_Y)
	{
		m_X = a_X * m_DeviceX;
		m_Y = a_Y * m_DeviceY;
		m_ScreenX = (int)a_X;
		m_ScreenY = (int)a_Y;

		m_Down = true;
	}

	void TouchScreenWM6::InjectRelease(float a_X, float a_Y)
	{
		m_Down = false;
		m_Click = true;
	}

	void TouchScreenWM6::Clear()
	{
		m_Down = false;
		m_Click = false;
	}

	bool TouchScreenWM6::Pressed()
	{
		return m_Down;
	}

	bool TouchScreenWM6::Released()
	{
		return m_Click;
	}

	YoghurtGum::Vec2 TouchScreenWM6::GetPos()
	{
		return Vec2((float)m_X, (float)m_Y);
	}

	float TouchScreenWM6::GetX()
	{
		return m_X;
	}

	float TouchScreenWM6::GetY()
	{
		return m_Y;
	}

	int TouchScreenWM6::GetScreenX()
	{
		return m_ScreenX;
	}

	int TouchScreenWM6::GetScreenY()
	{
		return m_ScreenY;
	}

	void TouchScreenWM6::Resize(int a_Width, int a_Height)
	{
		YG_STUB;
	}

}; // namespace YoghurtGum